<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="ctx" th:context="${#request.getContextPath()}">
    <script th:src="@{/static/js/jquery-3.3.1.js}"></script>
    <link rel="stylesheet" th:href="@{/static/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
    <script th:src="@{/static/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
    <link rel="stylesheet" th:href="@{/static/css/header.css}">
    <script th:src="@{/static/js/user/utils.js}"></script>
    <script th:src="@{/static/js/cource/adminCarousel.js}"></script>
    <title>轮播图</title>
</head>
<body>
<div th:replace="commons/header :: navbar"></div>
<div class="container">
    <div class="row">
        <div class="col-md-offset-4">
            <h1>轮播图</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-offset-8">
            <button id="addCarousel" class="btn btn-primary" data-toggle="modal" data-target="#myModal" type="button"> 添加轮播图</button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover" id="admin_carousel_table">
                <thead>
                <tr>
                    <th>#</th>
                    <th>标题名</th>
                    <th>图片</th>
                    <th>链接</th>
                    <th>是否播放</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>

    <!--模态框-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    <form id="carouselFrom" class="form-horizontal" enctype ="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">标题名</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="name" id="carouselName" placeholder="标题名">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="carouselImg" class="col-sm-2 control-label">图片</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="image" id="carouselImg">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="carouselUrl" class="col-sm-2 control-label" >展示课程</label>
                            <div class="col-sm-10">
                                <select class="form-control" id="carouselUrl" name="url">
                                </select>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary" onclick="saveCarousel()">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>